.class public Les/f50;
.super Ljava/lang/Object;
.source "ClusterChain.java"


# instance fields
.field private a:Les/a50;

.field private b:Les/g50;

.field private c:[Ljava/lang/Long;

.field private d:J

.field private e:J


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method constructor <init>(JLes/a50;Les/g50;Les/h50;)V
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    iput-object p4, p0, Les/f50;->b:Les/g50;

    .line 3
    iput-object p3, p0, Les/f50;->a:Les/a50;

    .line 4
    invoke-virtual {p4, p1, p2}, Les/g50;->a(J)[Ljava/lang/Long;

    move-result-object p1

    iput-object p1, p0, Les/f50;->c:[Ljava/lang/Long;

    .line 5
    invoke-virtual {p5}, Les/h50;->a()I

    move-result p1

    int-to-long p1, p1

    iput-wide p1, p0, Les/f50;->d:J

    .line 6
    invoke-virtual {p5}, Les/h50;->c()J

    move-result-wide p1

    iput-wide p1, p0, Les/f50;->e:J

    return-void
.end method

.method private a(JI)J
    .locals 4

    .line 11
    iget-wide v0, p0, Les/f50;->e:J

    int-to-long v2, p3

    add-long/2addr v0, v2

    const-wide/16 v2, 0x2

    sub-long/2addr p1, v2

    iget-wide v2, p0, Les/f50;->d:J

    mul-long p1, p1, v2

    add-long/2addr v0, p1

    return-wide v0
.end method


# virtual methods
.method a()I
    .locals 1

    .line 15
    iget-object v0, p0, Les/f50;->c:[Ljava/lang/Long;

    array-length v0, v0

    return v0
.end method

.method a(I)V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 12
    invoke-virtual {p0}, Les/f50;->a()I

    move-result v0

    if-ne p1, v0, :cond_0

    return-void

    :cond_0
    if-le p1, v0, :cond_1

    .line 13
    iget-object v1, p0, Les/f50;->b:Les/g50;

    iget-object v2, p0, Les/f50;->c:[Ljava/lang/Long;

    sub-int/2addr p1, v0

    invoke-virtual {v1, v2, p1}, Les/g50;->a([Ljava/lang/Long;I)[Ljava/lang/Long;

    move-result-object p1

    iput-object p1, p0, Les/f50;->c:[Ljava/lang/Long;

    goto :goto_0

    .line 14
    :cond_1
    iget-object v1, p0, Les/f50;->b:Les/g50;

    iget-object v2, p0, Les/f50;->c:[Ljava/lang/Long;

    sub-int/2addr v0, p1

    invoke-virtual {v1, v2, v0}, Les/g50;->b([Ljava/lang/Long;I)[Ljava/lang/Long;

    move-result-object p1

    iput-object p1, p0, Les/f50;->c:[Ljava/lang/Long;

    :goto_0
    return-void
.end method

.method a(J)V
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 16
    iget-wide v0, p0, Les/f50;->d:J

    add-long/2addr p1, v0

    const-wide/16 v2, 0x1

    sub-long/2addr p1, v2

    div-long/2addr p1, v0

    long-to-int p2, p1

    .line 17
    invoke-virtual {p0, p2}, Les/f50;->a(I)V

    return-void
.end method

.method a(JLjava/nio/ByteBuffer;)V
    .locals 9
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-virtual {p3}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v0

    .line 2
    iget-wide v1, p0, Les/f50;->d:J

    div-long v3, p1, v1

    long-to-int v4, v3

    .line 3
    rem-long v5, p1, v1

    const-wide/16 v7, 0x0

    cmp-long v3, v5, v7

    if-eqz v3, :cond_0

    .line 4
    rem-long/2addr p1, v1

    long-to-int p2, p1

    int-to-long v5, p2

    sub-long/2addr v1, v5

    long-to-int p1, v1

    .line 5
    invoke-static {v0, p1}, Ljava/lang/Math;->min(II)I

    move-result p1

    .line 6
    invoke-virtual {p3}, Ljava/nio/ByteBuffer;->position()I

    move-result v1

    add-int/2addr v1, p1

    invoke-virtual {p3, v1}, Ljava/nio/ByteBuffer;->limit(I)Ljava/nio/Buffer;

    .line 7
    iget-object v1, p0, Les/f50;->a:Les/a50;

    iget-object v2, p0, Les/f50;->c:[Ljava/lang/Long;

    aget-object v2, v2, v4

    invoke-virtual {v2}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    invoke-direct {p0, v2, v3, p2}, Les/f50;->a(JI)J

    move-result-wide v2

    invoke-interface {v1, v2, v3, p3}, Les/a50;->a(JLjava/nio/ByteBuffer;)V

    add-int/lit8 v4, v4, 0x1

    sub-int/2addr v0, p1

    :cond_0
    :goto_0
    if-lez v0, :cond_1

    .line 8
    iget-wide p1, p0, Les/f50;->d:J

    int-to-long v1, v0

    invoke-static {p1, p2, v1, v2}, Ljava/lang/Math;->min(JJ)J

    move-result-wide p1

    long-to-int p2, p1

    .line 9
    invoke-virtual {p3}, Ljava/nio/ByteBuffer;->position()I

    move-result p1

    add-int/2addr p1, p2

    invoke-virtual {p3, p1}, Ljava/nio/ByteBuffer;->limit(I)Ljava/nio/Buffer;

    .line 10
    iget-object p1, p0, Les/f50;->a:Les/a50;

    iget-object v1, p0, Les/f50;->c:[Ljava/lang/Long;

    aget-object v1, v1, v4

    invoke-virtual {v1}, Ljava/lang/Long;->longValue()J

    move-result-wide v1

    const/4 v3, 0x0

    invoke-direct {p0, v1, v2, v3}, Les/f50;->a(JI)J

    move-result-wide v1

    invoke-interface {p1, v1, v2, p3}, Les/a50;->a(JLjava/nio/ByteBuffer;)V

    add-int/lit8 v4, v4, 0x1

    sub-int/2addr v0, p2

    goto :goto_0

    :cond_1
    return-void
.end method

.method b()J
    .locals 4

    .line 11
    iget-object v0, p0, Les/f50;->c:[Ljava/lang/Long;

    array-length v0, v0

    int-to-long v0, v0

    iget-wide v2, p0, Les/f50;->d:J

    mul-long v0, v0, v2

    return-wide v0
.end method

.method b(JLjava/nio/ByteBuffer;)V
    .locals 9
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-virtual {p3}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v0

    .line 2
    iget-wide v1, p0, Les/f50;->d:J

    div-long v3, p1, v1

    long-to-int v4, v3

    .line 3
    rem-long v5, p1, v1

    const-wide/16 v7, 0x0

    cmp-long v3, v5, v7

    if-eqz v3, :cond_0

    .line 4
    rem-long/2addr p1, v1

    long-to-int p2, p1

    int-to-long v5, p2

    sub-long/2addr v1, v5

    long-to-int p1, v1

    .line 5
    invoke-static {v0, p1}, Ljava/lang/Math;->min(II)I

    move-result p1

    .line 6
    invoke-virtual {p3}, Ljava/nio/ByteBuffer;->position()I

    move-result v1

    add-int/2addr v1, p1

    invoke-virtual {p3, v1}, Ljava/nio/ByteBuffer;->limit(I)Ljava/nio/Buffer;

    .line 7
    iget-object v1, p0, Les/f50;->a:Les/a50;

    iget-object v2, p0, Les/f50;->c:[Ljava/lang/Long;

    aget-object v2, v2, v4

    invoke-virtual {v2}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    invoke-direct {p0, v2, v3, p2}, Les/f50;->a(JI)J

    move-result-wide v2

    invoke-interface {v1, v2, v3, p3}, Les/a50;->b(JLjava/nio/ByteBuffer;)V

    add-int/lit8 v4, v4, 0x1

    sub-int/2addr v0, p1

    :cond_0
    :goto_0
    if-lez v0, :cond_1

    .line 8
    iget-wide p1, p0, Les/f50;->d:J

    int-to-long v1, v0

    invoke-static {p1, p2, v1, v2}, Ljava/lang/Math;->min(JJ)J

    move-result-wide p1

    long-to-int p2, p1

    .line 9
    invoke-virtual {p3}, Ljava/nio/ByteBuffer;->position()I

    move-result p1

    add-int/2addr p1, p2

    invoke-virtual {p3, p1}, Ljava/nio/ByteBuffer;->limit(I)Ljava/nio/Buffer;

    .line 10
    iget-object p1, p0, Les/f50;->a:Les/a50;

    iget-object v1, p0, Les/f50;->c:[Ljava/lang/Long;

    aget-object v1, v1, v4

    invoke-virtual {v1}, Ljava/lang/Long;->longValue()J

    move-result-wide v1

    const/4 v3, 0x0

    invoke-direct {p0, v1, v2, v3}, Les/f50;->a(JI)J

    move-result-wide v1

    invoke-interface {p1, v1, v2, p3}, Les/a50;->b(JLjava/nio/ByteBuffer;)V

    add-int/lit8 v4, v4, 0x1

    sub-int/2addr v0, p2

    goto :goto_0

    :cond_1
    return-void
.end method
